#ifndef     __ANALOG_H
#define     __ANALOG_H

#include "../utils/object.h"
#include "../utils/nocopyable.h"
#include "../service/config.h"
#include <stdint.h>

namespace driver {

class Analog : private utils::NoCopyable {

public:
    Analog();

    uint16_t kpa_value();

    inline uint16_t current_value() { return m_values[1]; }

    inline bool is_door_locked() {
        return current_value() >= service::config->door_lock_adc;
    }

private:
    uint16_t m_values[2];
};

inline utils::Object<Analog> analog;

}

#endif
